(in-package :logo)

(defun fd (distance)
  (let* ((x1 (round (turtle-x *turtle*)))
	 (y1 (round (turtle-y *turtle*)))
	 (x2 (round (+ x1 (* distance (cos (degrees->radians
					    (turtle-angle *turtle*)))))))
	 (y2 (round (+ y1 (* distance (sin (degrees->radians
					    (turtle-angle *turtle*))))))))
    (create-line *logo-display* (list x1 y1 x2 y2))
    (setf (turtle-x *turtle*) x2
	  (turtle-y *turtle*) y2)))

(defun rt (angle)
  (incf (turtle-angle *turtle*)
	angle))

(defun lt (angle)
  (decf (turtle-angle *turtle*)
	angle))